config :basic do
  redis = Platform.config.redis
  # every node has a redis, and share a same rds file
  config(:redis, :title => "NOSQL设置", :description => "非关系型数据库的相关设置", :order => 20) do
    item(:port, :title => "端口", :help => "连接非关系型数据库使用的端口", :validation => "required digits")    # port
    item(:maxmemory, :unit => "bytes", :title => "容量上限", :help => "非关系型数据库的最大容量")
  end.read do |cfg|
    redis.reload!
    cfg.port = redis.port
    cfg.maxmemory = redis.maxmemory
  end.apply do |data|
    # redis a internal object which represents the redis/conf
    # redis.with("redis.conf").set_properties(data)
    redis.port = data.port
    redis.maxmemory = data.maxmemory
    redis.apply!
  end

end
